<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/

if ($_SESSION["sUserAdminMsg"] != "")
{
    ?>
    <p><b>Message: <?=$_SESSION["sUserAdminMsg"];?></b></p>
    <?
    unset($_SESSION["sUserAdminMsg"]);
}
?>

<p>Current Users in the system</p>

<table border="0" cellpadding = "3">
<tr>
<td><b>Username</b></td>
<td><b>Full Name</b></td>
<td><b>Last Active</b></td>
<td><b>Options</b></td>
</tr>

<?

$aUser = $UserAdmin->GetUsers();

if (is_array($aUser))
{
    
    foreach ($aUser as $aRow)
    {
    ?>
    <tr>
        <td><?=$aRow["username"];?></td>
        <td><?=$aRow["firstname"]." ".$aRow["lastname"];?></td>
        <td><?=$aRow["lastActive"];?></td>
        <td>
        <?
        if ($aRow["active"] == 1)
        {
            ?>
            <a href="<?=$_SERVER["PHP_SELF"];?>?action=deactivate&username=<?=$aRow["username"];?>">Deactivate</a> |
            <?
        }
        ?>
        
        <?
        if ($aRow["active"] == 0)
        {
            ?>
            <a href="<?=$_SERVER["PHP_SELF"];?>?action=activate&username=<?=$aRow["username"];?>">Activate</a> |
            <?
        }
        ?>
        <a href="<?=$_SERVER["PHP_SELF"];?>?action=edituser&username=<?=$aRow["username"];?>">Edit</a> |
        <a href="<?=$_SERVER["PHP_SELF"];?>?action=resetpassword&username=<?=$aRow["username"];?>" onclick="javascript: return confirm ('Do you want to reset password for <?=$aRow["username"];?>?')">Reset Password</a></td>
    </tr>
    <?
    }
}
?>
</table>

